*** LIS Cross-section Data center in Luxembourg

* email: usersupport@lisdatacenter.org 

*** LIS Self Teaching Package 2022

*** Part I: Inequality, poverty, and social policy
*** Stata version

* last change of this version of the syntax: 15-01-2022.


** Exercise 2:	Sample selection and weighting

use dhi hifactor hpub_i hpub_u hpub_a hiprivate hxitsc hpopwgt nhhmem grossnet using $gt06h, clear
gen miss_comp = 0
replace miss_comp=1 if dhi==. | hifactor==. | hpub_i==. | hpub_u ==. | hpub_a ==. | hiprivate==. | hxitsc==.
tab miss_comp
sum hpopwgt  dhi hifactor hpub_i hpub_u hpub_a hiprivate hxitsc, de
tab grossnet
sum hpopwgt dhi hifactor hpub_i hpub_u hpub_a hiprivate hxitsc [w=hpopwgt*nhhmem], de
drop if miss_comp==1
sum hpopwgt  dhi hifactor hpub_i hpub_u hpub_a hiprivate hxitsc [w=hpopwgt*nhhmem], de

use $gt06h, clear
tab currency
